package com.qf.springmvc02.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.qf.springmvc02.util.SalarySerialize;
import lombok.Data;

import java.util.Date;

/**
 * @author nk
 * @date 2022/5/4 17:29
 */
@Data
public class FastUser {
    //WriteMapNullValue 序列化null值的属性;WriteNullStringAsEmpty遇到null 变为"";
    @JSONField(serialzeFeatures = {SerializerFeature.WriteMapNullValue,SerializerFeature.WriteNullStringAsEmpty})
    private String id;

    @JSONField(name = "用户名")
    private String username;

    @JSONField(serialize = false)//序列化时忽略这个属性
    private String password;

//    @JSONField(format = "yyyy年MM月dd日")//format  指定日期格式
    private Date birthday;

//    @JSONField(format = "yyyy年MM月dd日")//format  指定日期格式
    private Date marryDay;
    @JSONField(serializeUsing = SalarySerialize.class)
    private Double salary;
    int i = 1/0;
}
